package infos

import (
	"github.com/gin-gonic/gin"
	"gogs.xiaoyuanjijiehao.com/antlinker/antcms/core"
)

// Init 初始化
func Init(route *gin.RouterGroup, d core.CmsDomain) {
	info := createInfoCtrl(d)
	//route.GET("infos", info.getInfoPageList)
	route.GET("infos/:infoid", info.getInfo)

	// route.GET("search", info.getSchPageList)
	// 获取指定栏目的信息
	route.GET("columns/:columnid", info.getColumn)
	route.GET("columns/:columnid/infos", info.getColumnInfoList)
	// route.GET("groups", info.getGroups)
	// route.GET("groups/:groupid/infos", info.getGroupInfoList)
	// 指定显示方式
	// route.GET("groups/:groupid", info.getGroup)
	// route.GET("groupinfos", info.getGroupInfos)

	route.GET("adapter/columns/:columnid/infos/:show", info.getColumnInfoList)
	route.GET("adapter/groups/:groupid/infos/:show", info.getGroupInfoList)
	route.GET("adapter/groups4key/:flags/infos/:show", info.getGroupInfoList4Key)
	route.GET("adapter/infos/:show", info.getInfoPageList)
	route.GET("adapter/myinfos/:show", info.getMyInfoPageList)

	route.GET("parks/:parkid", info.getParks)
	route.GET("parks/:parkid/carouse", info.getParksCarouse)
	route.GET("enterprises/:enterid", info.getEnterprises)
	route.GET("enterprises/:enterid/carouse", info.getEnterprisesCarouse)

	// route.POST("feedback", oplog.OplogRoute("api新增建议反馈", "cms/api/feedback/add", info.postFeedBack))
}
